package com.example.hrsystem.workflow.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.hrsystem.data.source.DateTypeConverters;

import java.util.Date;

/**
 * 审批请求基础类
 * 所有审批类型（请假、加班、出差）的父类
 */
@Entity(tableName = "approval_requests")
public abstract class ApprovalRequest {
    @PrimaryKey(autoGenerate = true)
    private int id;

    // 关联的流程实例ID
    private int processInstanceId;

    // 请求类型 (LEAVE, OVERTIME, BUSINESS_TRIP)
    private String requestType;

    // 申请人ID
    private int applicantId;

    // 申请原因
    private String reason;

    // 申请状态 (PENDING, APPROVED, REJECTED)
    private String status;

    // 创建时间
    @TypeConverters(DateTypeConverters.class)
    private Date createdAt;

    // 更新时间
    @TypeConverters(DateTypeConverters.class)
    private Date updatedAt;

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(int processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

    public int getApplicantId() {
        return applicantId;
    }

    public void setApplicantId(int applicantId) {
        this.applicantId = applicantId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
}